<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Arduino MIDI File Parser: RingBuffer Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Arduino MIDI File Parser
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="classRingBuffer-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">RingBuffer Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p><a class="el" href="classRingBuffer.html" title="RingBuffer that supports extensive peek operations to access and compare the next values.">RingBuffer</a> that supports extensive peek operations to access and compare the next values.  
 <a href="classRingBuffer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="RingBuffer_8h_source.html">RingBuffer.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad7a686dd23ee3e8af9421b0e7c62c50a"><td class="memItemLeft" align="right" valign="top"><a id="ad7a686dd23ee3e8af9421b0e7c62c50a" name="ad7a686dd23ee3e8af9421b0e7c62c50a"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>RingBuffer</b> (<a class="el" href="classRingBuffer.html">RingBuffer</a> &amp;t)</td></tr>
<tr class="separator:ad7a686dd23ee3e8af9421b0e7c62c50a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ea5a56078f9fab7c599bbe5f3a49e80"><td class="memItemLeft" align="right" valign="top"><a id="a7ea5a56078f9fab7c599bbe5f3a49e80" name="a7ea5a56078f9fab7c599bbe5f3a49e80"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>RingBuffer</b> (int <a class="el" href="classRingBuffer.html#a683564ff89be17d1be318f1b9e1a6bb3">size</a>)</td></tr>
<tr class="separator:a7ea5a56078f9fab7c599bbe5f3a49e80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af76770dd9bdfaf5afa8a1b6b2917bed0"><td class="memItemLeft" align="right" valign="top"><a id="af76770dd9bdfaf5afa8a1b6b2917bed0" name="af76770dd9bdfaf5afa8a1b6b2917bed0"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><b>read</b> ()</td></tr>
<tr class="separator:af76770dd9bdfaf5afa8a1b6b2917bed0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b82f430802f81d1cbf7a6fbb374394d"><td class="memItemLeft" align="right" valign="top"><a id="a1b82f430802f81d1cbf7a6fbb374394d" name="a1b82f430802f81d1cbf7a6fbb374394d"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>isFull</b> ()</td></tr>
<tr class="separator:a1b82f430802f81d1cbf7a6fbb374394d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a74c1b8941f14ca85ba27898d3dba46e6"><td class="memItemLeft" align="right" valign="top"><a id="a74c1b8941f14ca85ba27898d3dba46e6" name="a74c1b8941f14ca85ba27898d3dba46e6"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>isEmpty</b> ()</td></tr>
<tr class="separator:a74c1b8941f14ca85ba27898d3dba46e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac05005a3e40271799fabd15120161f02"><td class="memItemLeft" align="right" valign="top"><a id="ac05005a3e40271799fabd15120161f02" name="ac05005a3e40271799fabd15120161f02"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>write</b> (uint8_t data)</td></tr>
<tr class="separator:ac05005a3e40271799fabd15120161f02"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60b3a0c24cc535b1ef52bb74cb9b1053"><td class="memItemLeft" align="right" valign="top"><a id="a60b3a0c24cc535b1ef52bb74cb9b1053" name="a60b3a0c24cc535b1ef52bb74cb9b1053"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>write</b> (const uint8_t *data, size_t len)</td></tr>
<tr class="separator:a60b3a0c24cc535b1ef52bb74cb9b1053"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a49f9bf7beeefbcdd4469dfa2d111e7dd"><td class="memItemLeft" align="right" valign="top"><a id="a49f9bf7beeefbcdd4469dfa2d111e7dd" name="a49f9bf7beeefbcdd4469dfa2d111e7dd"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>reset</b> ()</td></tr>
<tr class="separator:a49f9bf7beeefbcdd4469dfa2d111e7dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20dc616ffef0b83fd845b40f351c1db8"><td class="memItemLeft" align="right" valign="top"><a id="a20dc616ffef0b83fd845b40f351c1db8" name="a20dc616ffef0b83fd845b40f351c1db8"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>available</b> ()</td></tr>
<tr class="separator:a20dc616ffef0b83fd845b40f351c1db8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28fec6fcf52c78bf66da2f3f469c9cdd"><td class="memItemLeft" align="right" valign="top"><a id="a28fec6fcf52c78bf66da2f3f469c9cdd" name="a28fec6fcf52c78bf66da2f3f469c9cdd"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>availableForWrite</b> ()</td></tr>
<tr class="separator:a28fec6fcf52c78bf66da2f3f469c9cdd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeeb500b7dd5616063c410dfe24667030"><td class="memItemLeft" align="right" valign="top"><a id="aeeb500b7dd5616063c410dfe24667030" name="aeeb500b7dd5616063c410dfe24667030"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>resize</b> (int len)</td></tr>
<tr class="separator:aeeb500b7dd5616063c410dfe24667030"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a683564ff89be17d1be318f1b9e1a6bb3"><td class="memItemLeft" align="right" valign="top"><a id="a683564ff89be17d1be318f1b9e1a6bb3" name="a683564ff89be17d1be318f1b9e1a6bb3"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>size</b> ()</td></tr>
<tr class="memdesc:a683564ff89be17d1be318f1b9e1a6bb3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the maximum capacity of the buffer. <br /></td></tr>
<tr class="separator:a683564ff89be17d1be318f1b9e1a6bb3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a257d1b7e2eeeeda66944e9ec0685b16d"><td class="memItemLeft" align="right" valign="top"><a id="a257d1b7e2eeeeda66944e9ec0685b16d" name="a257d1b7e2eeeeda66944e9ec0685b16d"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>peek</b> ()</td></tr>
<tr class="separator:a257d1b7e2eeeeda66944e9ec0685b16d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e0dfa8623361743ad9fb6d96069f44c"><td class="memItemLeft" align="right" valign="top"><a id="a6e0dfa8623361743ad9fb6d96069f44c" name="a6e0dfa8623361743ad9fb6d96069f44c"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>peek</b> (int idx)</td></tr>
<tr class="memdesc:a6e0dfa8623361743ad9fb6d96069f44c"><td class="mdescLeft">&#160;</td><td class="mdescRight">peeks the idx next entry from the buffer <br /></td></tr>
<tr class="separator:a6e0dfa8623361743ad9fb6d96069f44c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95f871c62ad4d6d16ccec67b27aadec9"><td class="memItemLeft" align="right" valign="top"><a id="a95f871c62ad4d6d16ccec67b27aadec9" name="a95f871c62ad4d6d16ccec67b27aadec9"></a>
uint8_t *&#160;</td><td class="memItemRight" valign="bottom"><b>peekStr</b> (int idx, int len)</td></tr>
<tr class="memdesc:a95f871c62ad4d6d16ccec67b27aadec9"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns a temporary copy of the requested bytes <br /></td></tr>
<tr class="separator:a95f871c62ad4d6d16ccec67b27aadec9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17fb46a75a5469507d15969c540ba92a"><td class="memItemLeft" align="right" valign="top"><a id="a17fb46a75a5469507d15969c540ba92a" name="a17fb46a75a5469507d15969c540ba92a"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><b>operator[]</b> (int idx)</td></tr>
<tr class="memdesc:a17fb46a75a5469507d15969c540ba92a"><td class="mdescLeft">&#160;</td><td class="mdescRight">alternaive syntax to peek(idx) <br /></td></tr>
<tr class="separator:a17fb46a75a5469507d15969c540ba92a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab2ebc0b4b037fc62178d87edc00f5677"><td class="memItemLeft" align="right" valign="top"><a id="ab2ebc0b4b037fc62178d87edc00f5677" name="ab2ebc0b4b037fc62178d87edc00f5677"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>equals</b> (const char *str)</td></tr>
<tr class="memdesc:ab2ebc0b4b037fc62178d87edc00f5677"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compares the string with the current peek values. <br /></td></tr>
<tr class="separator:ab2ebc0b4b037fc62178d87edc00f5677"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5772d16e5711646ba34d1ff88a5ef580"><td class="memItemLeft" align="right" valign="top"><a id="a5772d16e5711646ba34d1ff88a5ef580" name="a5772d16e5711646ba34d1ff88a5ef580"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>consume</b> (int offset)</td></tr>
<tr class="memdesc:a5772d16e5711646ba34d1ff88a5ef580"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes the next n characters from the ringbuffer. <br /></td></tr>
<tr class="separator:a5772d16e5711646ba34d1ff88a5ef580"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-methods" name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:aba5f96482d9d9d245fb62735326b9db4"><td class="memItemLeft" align="right" valign="top"><a id="aba5f96482d9d9d245fb62735326b9db4" name="aba5f96482d9d9d245fb62735326b9db4"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>nextIndex</b> (int index)</td></tr>
<tr class="separator:aba5f96482d9d9d245fb62735326b9db4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-attribs" name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:ad9d07270dbba19b50bdd8cfdab16d94b"><td class="memItemLeft" align="right" valign="top"><a id="ad9d07270dbba19b50bdd8cfdab16d94b" name="ad9d07270dbba19b50bdd8cfdab16d94b"></a>
uint8_t *&#160;</td><td class="memItemRight" valign="bottom"><b>_aucBuffer</b> = nullptr</td></tr>
<tr class="separator:ad9d07270dbba19b50bdd8cfdab16d94b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a69a16070b8bafc77bde5b69e8fa08756"><td class="memItemLeft" align="right" valign="top"><a id="a69a16070b8bafc77bde5b69e8fa08756" name="a69a16070b8bafc77bde5b69e8fa08756"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>_iHead</b></td></tr>
<tr class="separator:a69a16070b8bafc77bde5b69e8fa08756"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac42370872f521a194fe2193c203d3d9d"><td class="memItemLeft" align="right" valign="top"><a id="ac42370872f521a194fe2193c203d3d9d" name="ac42370872f521a194fe2193c203d3d9d"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>_iTail</b></td></tr>
<tr class="separator:ac42370872f521a194fe2193c203d3d9d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5673d3a69d5054c0ead4c2c8cbb00c03"><td class="memItemLeft" align="right" valign="top"><a id="a5673d3a69d5054c0ead4c2c8cbb00c03" name="a5673d3a69d5054c0ead4c2c8cbb00c03"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>_numElems</b></td></tr>
<tr class="separator:a5673d3a69d5054c0ead4c2c8cbb00c03"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e899538e0a478ea281e9b0a2124400c"><td class="memItemLeft" align="right" valign="top"><a id="a5e899538e0a478ea281e9b0a2124400c" name="a5e899538e0a478ea281e9b0a2124400c"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>max_size</b> = 0</td></tr>
<tr class="separator:a5e899538e0a478ea281e9b0a2124400c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classRingBuffer.html" title="RingBuffer that supports extensive peek operations to access and compare the next values.">RingBuffer</a> that supports extensive peek operations to access and compare the next values. </p>
<dl class="section author"><dt>Author</dt><dd>Phil Schatzmann </dd></dl>
</div><hr/>The documentation for this class was generated from the following file:<ul>
<li>src/<a class="el" href="RingBuffer_8h_source.html">RingBuffer.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6
</small></address>
</body>
</html>
